﻿@{
    var controller = Url.RequestContext.RouteData.Values["controller"].ToString();
    var action = Url.RequestContext.RouteData.Values["action"].ToString();
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/css/common.css")" rel="stylesheet" />
    <link href="@Url.Content("~/css/meishi.css")" rel="stylesheet" />
    <script type="text/javascript" src="@Url.Content("~/js/jquery-1.7.2.min.js")"></script>
    <script type="text/javascript">
        $().ready(function () {
            $(".action_nav a").click(function () {
                $('.action_nav li').removeClass('ac');
                $(this).parents('li').addClass("ac");
            });

        });
    </script>
    <script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
</head>
<body>
    <div class="main">
        <div class="header">
            <div class="header_wz">
                <a href="#">中文 </a>| <a href="#">English</a>
            </div>
        </div>
        <div class="container">
            <div class="eye">
                <div class="nav">
                    <a href="../introduction/History.html" title="about" style="width: 120px; left: 220px;
                        top: 5px;"></a><a href="../Board/board_AlanWay.html" title="Board" style="width: 80px;
                            left: 350px; top: 5px;"></a>
                    @Html.ActionLink(" ", "Now", "WebEvents",null, new { style = "width: 80px;left: 440px; top: 5px;", title = "Events" })
                    <a href="../ribbon/ribbon.html" title="Ribbon" style="width: 80px; left: 540px; top: 5px;">
                    </a><a href="#" title="Contacts us" style="width: 80px; left: 650px; top: 5px;">
                    </a><a href="#" title="login in" style="width: 50px; left: 860px; top: 5px;"></a>
                    <a href="#" title="Sign up" style="width: 50px; left: 910px; top: 5px;"></a>
                </div>
                <div class="big_intro">
                    <ul class="clearfix">
                        <li><a href="#">
                            <img src="../images/temp/1000215_1.jpg" width="1000" height="215" /></a></li>
                        <li style="display: none;"><a href="#">
                            <img src="../images/temp/1000215_2.jpg" width="1000" height="215" /></a></li>
                    </ul>
                </div>
                <div class="narrow clearfix">
                    <div class="l_narrow" style="opacity: 0.8; filter: alpha(opacity=80);">
                    </div>
                    <div class="r_narrow" style="opacity: 0.8; filter: alpha(opacity=80);">
                    </div>
                </div>
            </div>
            <div class="content content_bg clearfix">
                <div class="left">
                    <div class="action_nav">
                        @{
                            var comingUpEvents = Chaine.DAO.EventManager.GetComingUpEvents();
                            if (comingUpEvents != null && comingUpEvents.Count > 0)
                            {
                                var date = "";
                                if (action.Equals("detail"))
                                {
                                    date = Url.RequestContext.RouteData.Values["date"].ToString();
                                }
                            <h3>
                                Coming up Events</h3>
                            <ul>
                                @foreach (var item in comingUpEvents)
                                {
                                    <li class="@(date.Equals(item.StartDateTime.ToString("yyyyMMdd").ToString()) ? "ac" : "")">
                                        @Html.ActionLink(item.StartDateTime.ToString("MMM dd", System.Globalization.CultureInfo.CreateSpecificCulture("en-US")),
                                 "detail", new { date = item.StartDateTime.ToString("yyyyMMdd") })
                                    </li>
                                }
                            </ul>
                            }
                        }
                        @{
                            var latestEvent = Chaine.DAO.EventManager.GetLatestEvent();
                            if (latestEvent != null)
                            {
                                var date = "";
                                if (action.Equals("detail"))
                                {
                                    date = Url.RequestContext.RouteData.Values["date"].ToString();
                                }
                            <h3>
                                Latest Events</h3>
                            <ul class="latest-events">
                                <li class="@(date.Equals(latestEvent.StartDateTime.ToString("yyyyMMdd").ToString()) ? "ac" : "")">
                                    @Html.ActionLink(latestEvent.StartDateTime.ToString("MMM dd", System.Globalization.CultureInfo.CreateSpecificCulture("en-US")),
                                "detail", new { date = latestEvent.StartDateTime.ToString("yyyyMMdd") })
                                </li>
                            </ul>
                            }
                        }
                        <h3>
                            Past Events</h3>
                        <div class="calendar clearfix">
                            <ul>
                                @{
                                    var years = Chaine.DAO.EventManager.GetYear();
                                    var year = "";
                                    if (action.Equals("index"))
                                    {
                                        year = Url.RequestContext.RouteData.Values["year"].ToString();
                                    }
                                    if (action.Equals("detail"))
                                    {
                                        year = Url.RequestContext.RouteData.Values["date"].ToString().Substring(0, 4);
                                    }
                                    foreach (var i in years)
                                    {
                                    <li class="@(i.ToString().Equals(year) ? "ac" : "")">
                                        @Html.ActionLink(i.ToString(), "index", "WebEvents", new { year = i.ToString() }, null)
                                    </li>
                                    }
                                }
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="right">
                    @RenderSection("maincontent")
                </div>
            </div>
            <div class="footer">
                <p>
                    © 2004-2012 Confrérie La Chaîne des Rôtisseurs</p>
                <p>
                    <a href="#">About Chaine</a><a href="#">Board</a><a href="#">Events</a><a href="#">Ribbon</a><a
                        href="#">Contact us</a></p>
            </div>
        </div>
    </div>
</body>
</html>
